\(\int \cot (c+d x) (a+i a \tan (c+d x)) \, dx\) [7]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 20, antiderivative size = 19 \[ \int \cot (c+d x) (a+i a \tan (c+d x)) \, dx=i a x+\frac {a \log (\sin (c+d x))}{d} \]

[Out]

I*a*x+a*ln(sin(d*x+c))/d

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {3612, 3556} \[ \int \cot (c+d x) (a+i a \tan (c+d x)) \, dx=\frac {a \log (\sin (c+d x))}{d}+i a x \]

[In]

Int[Cot[c + d*x]*(a + I*a*Tan[c + d*x]),x]

[Out]

I*a*x + (a*Log[Sin[c + d*x]])/d

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3612

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c +
b*d)*(x/(a^2 + b^2)), x] + Dist[(b*c - a*d)/(a^2 + b^2), Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x]
 /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[a*c + b*d, 0]

Rubi steps \begin{align*} \text {integral}& = i a x+a \int \cot (c+d x) \, dx \\ & = i a x+\frac {a \log (\sin (c+d x))}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.63 \[ \int \cot (c+d x) (a+i a \tan (c+d x)) \, dx=i a x+\frac {a \log (\cos (c+d x))}{d}+\frac {a \log (\tan (c+d x))}{d} \]

[In]

Integrate[Cot[c + d*x]*(a + I*a*Tan[c + d*x]),x]

[Out]

I*a*x + (a*Log[Cos[c + d*x]])/d + (a*Log[Tan[c + d*x]])/d

Maple [A] (verified)

Time = 0.34 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.42

method result size
risch \(-\frac {2 i a c}{d}+\frac {a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}\) \(27\)
parallelrisch \(\frac {a \left (2 i d x +2 \ln \left (\tan \left (d x +c \right )\right )-\ln \left (\sec ^{2}\left (d x +c \right )\right )\right )}{2 d}\) \(33\)
norman \(i a x +\frac {a \ln \left (\tan \left (d x +c \right )\right )}{d}-\frac {a \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) \(36\)
derivativedivides \(\frac {a \left (\ln \left (\tan \left (d x +c \right )\right )-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+i \arctan \left (\tan \left (d x +c \right )\right )\right )}{d}\) \(37\)
default \(\frac {a \left (\ln \left (\tan \left (d x +c \right )\right )-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+i \arctan \left (\tan \left (d x +c \right )\right )\right )}{d}\) \(37\)

[In]

int(cot(d*x+c)*(a+I*a*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

-2*I*a/d*c+a/d*ln(exp(2*I*(d*x+c))-1)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.89 \[ \int \cot (c+d x) (a+i a \tan (c+d x)) \, dx=\frac {a \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right )}{d} \]

[In]

integrate(cot(d*x+c)*(a+I*a*tan(d*x+c)),x, algorithm="fricas")

[Out]

a*log(e^(2*I*d*x + 2*I*c) - 1)/d

Sympy [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.05 \[ \int \cot (c+d x) (a+i a \tan (c+d x)) \, dx=\frac {a \log {\left (e^{2 i d x} - e^{- 2 i c} \right )}}{d} \]

[In]

integrate(cot(d*x+c)*(a+I*a*tan(d*x+c)),x)

[Out]

a*log(exp(2*I*d*x) - exp(-2*I*c))/d

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 37 vs. \(2 (17) = 34\).

Time = 0.29 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.95 \[ \int \cot (c+d x) (a+i a \tan (c+d x)) \, dx=-\frac {-2 i \, {\left (d x + c\right )} a + a \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 2 \, a \log \left (\tan \left (d x + c\right )\right )}{2 \, d} \]

[In]

integrate(cot(d*x+c)*(a+I*a*tan(d*x+c)),x, algorithm="maxima")

[Out]

-1/2*(-2*I*(d*x + c)*a + a*log(tan(d*x + c)^2 + 1) - 2*a*log(tan(d*x + c)))/d

Giac [A] (verification not implemented)

none

Time = 0.35 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.79 \[ \int \cot (c+d x) (a+i a \tan (c+d x)) \, dx=-\frac {2 \, a \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + i\right ) - a \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}{d} \]

[In]

integrate(cot(d*x+c)*(a+I*a*tan(d*x+c)),x, algorithm="giac")

[Out]

-(2*a*log(tan(1/2*d*x + 1/2*c) + I) - a*log(tan(1/2*d*x + 1/2*c)))/d

Mupad [B] (verification not implemented)

Time = 4.21 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00 \[ \int \cot (c+d x) (a+i a \tan (c+d x)) \, dx=\frac {a\,\mathrm {atan}\left (2\,\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,2{}\mathrm {i}}{d} \]

[In]

int(cot(c + d*x)*(a + a*tan(c + d*x)*1i),x)

[Out]

(a*atan(2*tan(c + d*x) + 1i)*2i)/d